class CreateGroupSpaceSchedules < ActiveRecord::Migration
  def self.up
    create_table :group_space_schedules do |t|
      t.references :group_space
      t.references :group_schedule
      t.references :interval

      t.timestamps
    end
    add_index(:group_space_schedules, [:group_space_id, :group_schedule_id, :interval_id], 
      :unique => true, :name => "group_space_schedules_gsid_gscid_iid")
  end

  def self.down
    remove_index(:group_space_schedules, :name => "group_space_schedules_gsid_gscid_iid")
    drop_table :group_space_schedules
  end
end
